package com.springcloud.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @ProjectName: springcloud_1
 * @Package: com.com.springcloud.config
 * @ClassName: ConfigBean
 * @Author: 郑涛
 * @Description:
 * @Date: 2020/10/16 16:05
 * @Version: 1.0
 */
@Configuration
public class ConfigBean {
    @Bean
    @LoadBalanced //ribbon
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

    @Bean
    public IRule myrule(){
        return new RandomRule();
    }
}
